<template>
  <div>
    <detall-banner
    :sightName="sightName"
    :bannerImg="bannerImg"
    :gallaryImgs="gallaryImgs"></detall-banner>
    <detall-header></detall-header>
    <div class="content">
      <detail-list :list="list"></detail-list>
    </div>
    <detail-header></detail-header>
  </div>
</template>

<script>
 import DetallBanner from  './components/Banner'
 import DetallHeader from  './components/Header'
 import DetailList from  './components/List'
 import DetailHeader from  './components/Header'
 import axios from  'axios'
  export  default{
    name: 'Detall',
    components: {
      DetallBanner,
      DetailHeader,
      DetailList,
      DetallHeader
   },
    data () {
      return {
      sightName: '',
      bannerImg: '',
      gallaryImgs: [],
      list: []
    }
  },
  methods: {
    getDetailInfo () {
      axios.get('/api/detail.json',{
        params: {
          id: this.$route.params.id
        }
      }).then(this.handleGetDataSucc)
      },
      handleGetDataSucc (res) {
        res = res.data
        if(res.ret && res.data) {
          const data = res.data
          this.sightName = data.sightName
          this.bannerImg = data.bannerImg
          this.gallaryImgs = data.gallaryImgs
          this.list = data.categoryList
        }
      }
  },
  mounted () {
    this.getDetailInfo()
  }
  }
</script>

<style>
</style>
